set proc to TGPproc
set proc to boxproc
do start
tanggal = date()
dr      = 'N:'
F1      = 'USERCASH'
progr   = 'PWCAS1'
store .f. to exactpw,accpw
STORE SPACE(16) TO USERNM,USNM, USNM2, USNM3
STORE 0 TO PIL,compt,MESC
sele 1
set exclu off
use &dr&f1

SET COLOR TO W+/B
clea
SET COLOR TO W+/BG
@ 2,4 CLEA TO 22,75
DO BOXE WITH 6,21,"Enter your Name :",'USNM','W+','B+','GR+','R+',16,.T.,.T.
USNM=ALLTRIM(UPPER(USNM))
go top
LOCAT FOR STAF_NAME=USNM
csno=cash_numb
IF FOUND()
   DO CHEKPW
   IF LASTKEY()=27
      RETURN
   ENDIF
   SET COLO TO BG/BG
   @ 11, 6 CLEAR TO 21,69
   IF CASH_NUMB<>0
      SET COLO TO R+*/BG
      KET=USNM+' ALREADY REGISTERED ON CASHIER '+STR(CSNO,1)
      KOL=(80-LEN(KET))/2
      @ 12,KOL SAY KET
      PIL1=0
      DO BOX2 WITH 15,10,"DO YOU WANT TO CHANGE TO ANOTHER COMPUTER ? :","YES","NO",'GR+','RB','GR+','R',PIL1,.F.,.T.
      IF PIL1=2 .OR. LASTKEY()=27
         RETU
      ENDIF
   ENDIF
ELSE
   PIL2=0
   DO BOX2 WITH 15,15,"IS HE/SHE A NEW CASHIER ? :","YES","NO",'GR+','RB','GR+','R',PIL2,.F.,.T.
   IF PIL2=1
      IF FIL_LOCK()
         APPEN BLANK
      ENDIF
      IF REC_LOCK()
         REPL STAF_NAME WITH USNM
      ENDIF
      UNLOCK
   ENDIF
   DO MAKEPW
ENDI
SET COLO TO W+*/BG
USERNM=USNM
USE &DR&F1
SET EXCLU OFF
LOCA FOR STAF_NAME=USERNM
IF EOF()
   RETURN
ENDIF
SET COLO TO B/BG+
@ 10,6 CLEAR TO 20,67
csno=0
do boxn with 12,25,'Computer Cashier #. :','csno','99','BG+','B','W+','N','99','0',.F.,.F.
LOCAT FOR CASH_NUMB=CSNO
CSNM=STAF_NAME
IF FOUND()
   IF CASH_NUMB<>0
      SET COLO TO R+*/BG
      KET=' COMPUTER #.'+STR(CSNO,1)+' IS USED BY '+ALLTRIM(CSNM)
      KOL=40-((LEN(KET)/2))
      @ 10,6 CLEAR TO 20,67
      @ 11,KOL SAY KET
      PIL1=0
      DO BOX2 WITH 15,17,"DO YOU WANT TO USE THAT COMPUTER ? :","YES","NO",'GR+','RB','GR+','R',PIL1,.F.,.T.
      IF PIL1=2 .OR. LASTKEY()=27
         RETU
      ELSE
*         DO CHEKPW
         IF REC_LOCK()
            REPL CASH_NUMB WITH 0
         ENDIF
         UNLOCK
      ENDIF
   ENDIF
ENDIF
LOCAT FOR STAF_NAME=USNM
IF FOUND()
   if rec_lock()
      repl cash_numb with csno
   endif
   unlock
endif

clear
RETURN
